local sk__yuhua = fk.CreateSkill {

  name = "sk__yuhua",

  tags = {  },

}



sk__yuhua:addEffect(fk.DamageCaused, {
  name = "sk__yuhua",
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(sk__yuhua.name) and data.card and data.card.type == Card.TypeTrick
  end,
  on_cost = function(self, event, target, player, data)
    local prompt = "#sk__yuhua1-invoke::"..data.to.id
    return player.room:askForSkillInvoke(player, sk__yuhua.name, nil, prompt)
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, sk__yuhua.name)
    if not player.dead and player:getMaxCards() > 0 then
      player.room:addPlayerMark(player, MarkEnum.MinusMaxCards, 1)
    end
    data:preventDamage()
  end,
})
sk__yuhua:addEffect(fk.DamageInflicted, {
  name = "sk__yuhua",
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(sk__yuhua.name) and data.card and data.card.type == Card.TypeTrick
  end,
  on_cost = function(self, event, target, player, data)
    local prompt = "#sk__yuhua2-invoke"
    return player.room:askForSkillInvoke(player, sk__yuhua.name, nil, prompt)
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, sk__yuhua.name)
    if not player.dead and player:getMaxCards() > 0 then
      player.room:addPlayerMark(player, MarkEnum.MinusMaxCards, 1)
    end
    data:preventDamage()
  end,
})

return sk__yuhua